package PTA04;

import java.util.Arrays;
import java.util.Scanner;
public class Test04 {
public static void main(String[] args) {
	Scanner in=new Scanner(System.in);
	int n=in.nextInt();
	double []array=new double[n];
	for (int i = 0; i < array.length; i++) {
		array[i]=in.nextDouble();
	} 
	ArrayUtils.PairResult result=new ArrayUtils.PairResult();
	result=result.findMinMax(array);
	System.out.println(result.toString());
	System.out.println(ArrayUtils.PairResult.class);
}
}
class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		static PairResult findMinMax(double[] values){
			Arrays.sort(values);
			PairResult result=new PairResult();
			result.setMin(values[0]); 
			result.setMax(values[values.length-1]); 
			return result;
		}
		@Override
		public String toString() { 
			return "PairResult [min=" + getMin() + ", max=" + max + "]";
		}
		public double getMin() {
			return min;
		}
		public void setMin(double min) {
			this.min = min;
		}
		public double getMax() {
			return max;
		}
		public void setMax(double max) {
			this.max = max;
		}
		
	}
}


